package com.example.matriculagaleraufba;

import java.util.ArrayList;

import android.app.Fragment;
import android.app.ListFragment;
import android.os.Bundle;
import android.util.Log;
import android.view.InflateException;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;


public class FragmentEscolherCurso extends Fragment {
	
	
	private static View view;


@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	// TODO Auto-generated method stub   
   
     /*   //Criar um ArrayAdapter, que vai fazer aparecer as Strings acima
        //em seu ListView
    setListAdapter(new ArrayAdapter<String>(getActivity().getApplicationContext(), 
        							android.R.layout.simple_list_item_single_choice,
        							lstCursos));
    getListView().setTextFilterEnabled(true);*/

	if (view != null) {
        ViewGroup parent = (ViewGroup) view.getParent();
        if (parent != null)
            parent.removeView(view);
    }
    try {
        view = inflater.inflate(R.layout.escolher_curso, container, false);
    } catch (InflateException e) {
        /* map is already there, just return view as it is */
    }
    return view;
	//return inflater.inflate(R.layout.escolher_curso, container, false);
}

/*@Override
public void onDestroyView() {
    super.onDestroyView();
    FragmentEscolherCurso f = (FragmentEscolherCurso) getFragmentManager().findFragmentById(R.id.opcaoEscolhida);
    if (f != null) 
        getFragmentManager().beginTransaction().remove(f).commit();
}*/





/*public static class ArrayListFragment extends ListFragment {

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        setListAdapter(new ArrayAdapter<String>(getActivity(),
                android.R.layout.simple_list_item_single_choice, ListaCursos.lstCursos));
    }

    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {
        Log.i("FragmentList", "Item clicked: " + id);
    }
}*/

}
